﻿using System.Collections.Generic;
using System.Web.Mvc;
using AutoMapper;
using ITTestingSystem.BusinessLogic.DataServices.Abstract;
using ITTestingSystem.Models.Tests;

namespace ITTestingSystem.Controllers
{
    [Authorize]
    public partial class TestsController : Controller
    {
        private readonly ITestService _testService;

        public TestsController(ITestService testService)
        {
            _testService = testService;
        }

        //
        // GET: /Tests/

        public virtual ActionResult Index()
        {
            var tests = Mapper.Map<IEnumerable<TestViewModel>>(_testService.GetAll());

            return View(tests);
        }

    }
}
